﻿<!-- #include file="mymin.asp" -->
<title>内信管理</title></head><body><div class='main400'>
<%

dim id,a,rs,sql,page

id=getN("id",0)
a=getN("a",0)
page=getN("page",1)

if a=0 then
	set rs=Server.CreateObject("ADODB.Recordset")
	sql = "select m.id,m.userid,m.savetime,m.content,u.name from 74hu_message m left join 74hu_user u on m.userid=u.id order by m.id desc"
	rs.open sql,myconn,1,1
	If Not rs.eof Then
		dim pagesize,count,i,pagecount
		PageSize=10
		Count=rs.recordcount
		if page<1 then page=1
		pagecount=(count+pagesize-1)\pagesize
		if page>pagecount then page=pagecount
		rs.move(pagesize*(page-1))
		For i=1 To PageSize
		If rs.eof Then Exit For
			w "[<a href='msgs.asp?sid="&sid&"&amp;id="&rs("id")&"&amp;a=1'>删除</a>]<a href='detail.asp?sid="&sid&"&amp;id="&rs("userid")&"'>"&_
				nowml(rs("name"))&"</a>"&forDate2(rs("savetime"))&"说：<br/>"&getLeft(nowml(rs("content")),30)&"<br/>"
			rs.moveNext
		Next
		w showsPage("msgs.asp", "", page, pageCount)&""
	Else
		w "暂时没有消息！"
	end if
	rs.close
	set rs=nothing
elseif a=1 then
	w "删除信息会影响会员交流，降低体验。你确定删除?<br/>"&_
		"<a href='msgs.asp?sid="&sid&"&amp;id="&id&"&amp;a=2'>确定删除</a><br/>"&_
		"<a href='msgs.asp?sid="&sid&"&amp;page="&page&"'>返回管理</a>"
else
	myconn.execute("delete * from 74hu_message where id="&id)
	w "删除成功!<a href='msgs.asp?sid="&sid&"&amp;page="&page&"'>返回管理</a>"
end if

w "<br/>----------"
call bbsLast
%>